package com.just521.xinshoutong.listadapter;

import java.util.List;

import android.content.Context;
import android.view.InflateException;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.just521.xinshoutong.R;
import com.just521.xinshoutong.http.ImageDownLoader;


public class MainUserListAdapter<T> extends ListAdapter_base
{
	class ViewHolder{
		TextView age;
		TextView bodytype;
		TextView iwant;
		TextView height;
		TextView nickname;
		ImageView headimage;
		View sexbg;
		ImageView sexicon;
	}
	
	private ImageDownLoader asyncImageLoader;
	private	ListView		mList=null;
	
	public MainUserListAdapter(Context c,List<T> list, ListView lv )
	{	
		super(c,list);
		mList = lv;
		asyncImageLoader = new ImageDownLoader();
	}
	
	
	protected View initView(ViewGroup parent){
		View retV=null;
		try{
			retV = mfactory.inflate(R.layout.main_notelist_item,parent, false);
			ViewHolder temp = new ViewHolder();
//			temp.age=(TextView)retV.findViewById(R.id.item_age);
//			temp.nickname=(TextView)retV.findViewById(R.id.item_username);
//			temp.headimage = (ImageView)retV.findViewById(R.id.item_image);
//			temp.bodytype = (TextView)retV.findViewById(R.id.item_body);
//			temp.height = (TextView)retV.findViewById(R.id.item_hight);
//			temp.iwant = (TextView)retV.findViewById(R.id.item_iwant);
//			temp.sexbg = retV.findViewById(R.id.item_sex_bg);
//			temp.sexicon = (ImageView)retV.findViewById(R.id.item_sex_icon);
			retV.setTag(temp);
		}catch(InflateException e){
		}
		return retV;
	}
	
	protected void setContent(View retV,Object content,int pos){
		
		ViewHolder temp = (ViewHolder)retV.getTag();
//		SimpleUserInfoRec rec=(SimpleUserInfoRec)content;
		
        

        //加载其他
        TextView tv_nickname = temp.nickname;
        TextView tv_age = temp.age;
        TextView tv_body = temp.bodytype;
        TextView tv_height = temp.height;
        TextView tv_iwant = temp.iwant;
        ImageView iv_sexicon = temp.sexicon;
        View iv_sexbg = temp.sexbg;
        
        
	}
	


}
